<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Raw XHR Example</title>
    <script type="text/javascript">
    
    var xmlRequestObject = false;
    
    /* This is a comment */
    
    if( window.XMLHttpRequest )
    {
       xmlRequestObject = new XMLHttpRequest();
    }
    else if( window.ActiveObject ){
       xmlRequestObject = new ActiveObject( "Microsoft.XMLHTTP" );
    }
    
    function getData( url, container ){
    
       var object = document.getElementById( container );
       
       xmlRequestObject.open( "GET", url );
       
       xmlRequestObject.onreadystatechange = function(){
       
          if( xmlRequestObject.readyState == 4 && xmlRequestObject.status == 200 )
          {
             object.innerHTML = xmlRequestObject.responseText;
          }
       
       }
       
       xmlRequestObject.send( null );
    }
    
    </script>
  </head>
  <body>
     <form>
        <input type = "button" value = "Fetch" onclick = "getData( 'http://localhost:8081/files/sample.txt', 'target' )">
     </form>
     <div id="target"></div>
  </body>
</html>




